<?php
// query menu item level 1 main menu
function main_menu(){
	$qr="select * from div_categories where extension='com_content' and parent_id=1";
	return mysql_query($qr);	
	}
//query menu item level 2 main menu	
function main_menu_sub($id){
	$qr="select * from div_categories where extension='com_content' and parent_id=$id";
	return mysql_query($qr);
	}
// query menu item level 1 top menu
function top_menu(){
	$qr="select * from div_menu where menutype='menu-top' and parent_id=1";
	return mysql_query($qr);
}
function book_cat($catid=-1){
	$qr="select * from div_content where (catid=$catid OR $catid=-1)";
	return mysql_query($qr);
}

// lay hinh article tu database joomla
function getParamsK($full, $find){
    $s = $find."\":\"";
    $arr = explode($s, $full);
    $arr2 = explode("\"", $arr[1]);
    return str_replace("\\","",$arr2[0]);
}

// lay noi dung tin trong bang content
function single($id){
	$qr="select * from div_content where id=$id";
	return mysql_query($qr);	
}

?>